package io;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class ISRDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("osw.txt");
        InputStreamReader isr = new InputStreamReader(fis, StandardCharsets.UTF_8);

        /*
             字符流的：
             int read（）
             读取1个字符，将对应的char值存入返回的int值的“低16位”上
             00000000 00000000 10101000 10101010
             如果返回-1，表示读取到了末尾

         */
        int d ;
        char[] a = new char[6];
        isr.read(a);
//        while((d = isr.read())!=-1){
//            System.out.print((char)d);
//        }
        System.out.println(a);
        isr.close();
    }
}
